package com.sd365.permission.centre.service;

import com.sd365.permission.centre.pojo.dto.ResourceDTO;
import com.sd365.permission.centre.pojo.query.ResourceQuery;
import com.sd365.permission.centre.pojo.vo.ResourceVO;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.CachePut;

import java.util.List;
@CacheConfig(cacheNames = "ResourcesService")
public interface ResourceService {

    List<ResourceDTO> initRedis(ResourceQuery resourceQuery);
    /**
     * @param: 模糊查询条件
     * 1. 节点名称 name
     * 2. 父亲节点 parentId
     * @return: SubSystemDTOs
     * @see
     * @since
     */
    List<ResourceDTO> commonQuery(ResourceQuery resourceQuery);

    List<ResourceDTO> query(ResourceQuery resourceQuery);

    @CachePut(key = "#p0.id")
    ResourceVO add (ResourceDTO resourceDTO);

    @CacheEvict(key = "#p0.id")
    Boolean remove(Long id);

    Boolean batchDelete(ResourceDTO[] resourceDTOS);

    @CachePut(key = "#p0.id")
    ResourceVO modify(ResourceDTO resourceDTO);

    ResourceDTO copy(Long id);

    ResourceDTO queryById(Long id);

    ResourceDTO findByParentId(Long id);

    List<ResourceDTO> queryResourceByMenu();


}
